package com.dykj.fireFighting.server.base.fireEngine.service.impl;


import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * @Description 消防车最新位置任务
 * @Author hxb
 * @Date 2021/11/23 15:59
 **/
@Slf4j
@Component
public class FireEngineScheduleJob {


    /**
     * 每10秒循环一次，一个线程共循环10次。
     */
    @Async("threadPoolTaskExecutor")
    public void ceshi3(int num) {
        for (int i = 0; i <= 10; i++) {
            log.info(num + "=========ceshi3: " + i);
            try {
                Thread.sleep(2000 * 5);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
